package hero.mps.inter_view;

public class IntegerIsPalindrome {
    public static boolean integerIsPalindrome(Integer num) {
        if (num <0 || (num % 10 == 0 && num != 0)){
            return false;
        }
        Integer rev = 0;
        while (num > rev) {
            rev = rev * 10 + num % 10;
            num = num / 10;
        }
        return num == rev || num == rev / 10;
    }

    public static void main(String[] args) {
        System.out.println(integerIsPalindrome(12321));
    }
}
